<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2{
            text-align: center;
        }
        table{
            border-collapse: collapse;
            height: 80px;
            margin: 0 auto;
        }
        th{
            padding: 5px 10px;
        }
        tr,th,td{
            text-align: center;
            border: 2px solid black;
        }
    </style>
</head>

<body>
    <script>
        let money = 100
        while (true) {
            let num = +prompt(`请输入您的操作 
            1.存钱
            2.取钱
            3.查询余额
            4.退出`)
            if (num === 4) {
                break
            }
            switch (num) {
                case (1):
                    let put = +prompt('请输入存款金额')
                    money += put
                    break
                case (2):
                    let pull = +prompt('请输入取款金额')
                    money -= pull
                    break
                case (3):
                    alert(`剩余余额为：${money}`)
                    break
            }
            document.write(`
            <h2>凭证</h2>
            <table>
                <tr>
                    <td>
                        剩余余额为：${money}
                    </td>
                </tr>
            </table>
            `)
        }
    </script>
</body>

</html>